<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="layout">
	<tiles:putAttribute name="head">
		<script type="text/javascript">
			$(function() {
				$(".date").datepicker({
					showWeek : true,
					firstDay : 1,
					dateFormat : 'yy-mm-dd',
					showOtherMonths : true,
					selectOtherMonths : true					
				});
			});
		</script>
	</tiles:putAttribute>
	<tiles:putAttribute name="mainBody">
		<form class="form-horizontal">
			<fieldset>
				<legend>Teacher Lessons Report</legend>
			</fieldset>
			<div class="control-group">
				<label class="control-label">时间范围</label>
				<div class="controls">
					<div class="form-inline">
						<input type="text" class="date input-small" name="startDate" value="${param.startDate}" />~<input type="text"
							class="date input-small" name="endDate" value="${param.endDate}" />
						<button class="btn btn-primary" type="submit">查询</button>
					</div>
				</div>
			</div>
		</form>
		<table class="table">
			<thead>
				<tr>
					<th>Teacher</th>
					<th>Canceled</th>
					<th>Sum</th>
					<th>Rate</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="#reports" var="report">
					<tr>
						<td><s:url action="listLesson" namespace="/lesson" id="listLesson">
								<s:param name="teacher" value="teacherId"></s:param>
								<s:param name="startDate" value="#parameters.startDate"></s:param>
								<s:param name="endDate" value="#parameters.endDate"></s:param>
							</s:url> <a href="${listLesson}">${report.teacherName}</a></td>
						<td><s:url action="listLesson" namespace="/lesson" id="listLesson">
								<s:param name="teacher" value="teacher.id"></s:param>
								<s:param name="startDate" value="#parameters.startDate"></s:param>
								<s:param name="endDate" value="#parameters.endDate"></s:param>
								<s:param name="canceled" value="'true'"></s:param>
							</s:url> <a href="${listLesson}">${report.blankLessonNum}</a></td>
						<td>${report.totalLessonNum}</td>
						<td>${report.blankRate}%</td>
					</tr>
				</s:iterator>
			</tbody>
			<tfoot></tfoot>
		</table>
	</tiles:putAttribute>
</tiles:insertDefinition>